// VBConversions Note: VB project level imports
using System.Collections.Generic;
using System;
using System.Linq;
using System.Drawing;
using System.Diagnostics;
using Microsoft.VisualBasic;
using System.Xml.Linq;
using Microsoft.VisualBasic.Compatibility;
using System.Windows.Forms;
using System.Collections;
using System.Data;
// End of VB project level imports


namespace 喷码数据生成工具
{
	public partial class Remedy_InputBox
	{
		private bool isLimiteKeyPress = true;
		public Remedy_InputBox()
		{
			
			// 此调用是 Windows 窗体设计器所必需的。
			InitializeComponent();
			
			// 在 InitializeComponent() 调用之后添加任何初始化。
			
		}
		public Remedy_InputBox(string Title)
		{
			
			// 此调用是 Windows 窗体设计器所必需的。
			InitializeComponent();
			
			// 在 InitializeComponent() 调用之后添加任何初始化。
			this.Text = Title;
		}
		public Remedy_InputBox(string Title, string DefaultValue)
		{
			
			// 此调用是 Windows 窗体设计器所必需的。
			InitializeComponent();
			
			// 在 InitializeComponent() 调用之后添加任何初始化。
			this.Text = Title;
			this.TextBox1.Text = DefaultValue;
		}
		public Remedy_InputBox(string Title, string defaultValue, bool KeyPressLimite)
		{
			InitializeComponent();
			isLimiteKeyPress = KeyPressLimite;
			this.Text = Title;
			this.TextBox1.Text = defaultValue;
		}
		public void TextBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (isLimiteKeyPress == false)
			{
				return ;
			}
			if (Strings.Asc(e.KeyChar) == 8)
			{
				return ;
			}
			if (Strings.Asc(e.KeyChar) < 48 || Strings.Asc(e.KeyChar) > 57)
			{
				e.Handled = true;
			}
		}
		
		public void TextBox1_TextChanged(System.Object sender, System.EventArgs e)
		{
			RemedyCode.InputText = TextBox1.Text;
		}
		
		public void Btn_Cancel_Click(object sender, System.EventArgs e)
		{
			RemedyCode.SelectInput = RemedyCode.InputDialogResult.Cancel;
		}
		
		public void Btn_Ok_Click(object sender, System.EventArgs e)
		{
			RemedyCode.SelectInput = RemedyCode.InputDialogResult.OK;
			this.Close();
		}
		
		public void Remedy_InputBox_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
		{
			
		}
		
		public void Remedy_InputBox_Load(System.Object sender, System.EventArgs e)
		{
			CommFunction.ChangeButtonFromFrm(this);
		}
		protected override void WndProc(ref System.Windows.Forms.Message m)
		{
			if (m.Msg == 161 && m.WParam == 20)
			{
				RemedyCode.SelectInput = RemedyCode.InputDialogResult.Cancel;
			}
			base.WndProc(ref m);
		}
	}
}
